<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <head th:replace="common/common_css :: css(~{::link})">
    </head>
    <title>门诊就诊</title>
    <link rel="stylesheet" type="text/css" th:href="@{css/mcss/mcss_outpatient.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/css/chosen.min.css}"/>
    <link type="text/css" rel="stylesheet" th:href="@{/css/preloader.css}">
</head>
<body>

<div id="preloader">
    <div id="preloader-inner"></div>
</div>
<div id="wrapper">
    <div th:replace="common/common_left :: left"></div>

    <div id="content-wrapper" class="d-flex flex-column content-wrapper">
        <div id="content">
            <div th:replace="common/common_head :: head"></div>

            <!--正文-->
            <div>
                <div class="card shadow mb-4" style="margin-left: 2.5%;height: 818px">

                    <!--<div class="card-header py-3">-->
                    <!--<h6 class="m-0 font-weight-bold text-primary">demo</h6>-->
                    <!--</div>-->

                    <div class="card-body">
                        <div style="display: flex">
                            <div class="outpatient-div split split-horizontal" id="outpatient-one">
                                <div class="card-header py-3">
                                    <h6 class="m-0 font-weight-bold text-primary">患者基本信息</h6>
                                </div>

                                <div style="margin-left: 12%">
                                    <div class="textbox">
                                        卡号<input type="text" style="width: 140px"  id="cardId">
                                        <div class="mybtn1">
                                            <button class="btn btn-info" onclick="getCardIdInfor()">读取就诊卡</button>
                                        </div>
                                    </div>


                                    <div class="textbox_2">

                                        姓名<input type="text" id="name" style="width: 110px" >&emsp;
                                        性别<input type="text" id="sex" style="width: 110px" ><br>
                                        <br>
                                        民族<input type="text" id="nationality" style="width: 110px" >&emsp;
                                        年龄<input type="text" id="age" style="width:110px" >
                                        <br>
                                        <br>
                                        <div id="new-img" style=" visibility: hidden">
                                            <img style="width: 35px;height: 35px;"
                                                 th:src="@{/images/icon/newPatien.png}" title="请记录新开卡的病人信息">
                                        </div>
                                        婚姻<input type="text" id="maritalStatus" style="width: 110px">&emsp;
                                        职业<input type="text" id="career" style="width:110px">
                                        <br>
                                        <br>
                                        <br>
                                        <div style="display: flex;">
                                            <div>个人史</div>
                                            <textarea id="personalHistory"></textarea>
                                        </div>

                                        <div style="display: flex; margin-top: 30px">
                                            <div>既往史</div>
                                            <textarea type="text" id="pastHistory"></textarea>
                                        </div>

                                        <div style="display: flex;margin-top: 30px">
                                            <div>家族史</div>
                                            <textarea type="text" id="familyHistory"></textarea>
                                        </div>

                                        <div class="mybtn2" id="new-submit">
                                            <button class="btn btn-info" onclick="changePatientInfor()">提交修改</button>
                                        </div>

                                    </div>
                                </div>
                            </div>
                            <div class="outpatient-div" id="outpatient-two">
                                <div class="split" id="outpatient-two-1">
                                    <div class="card-header py-3">
                                        <h6 class="m-0 font-weight-bold text-primary">患者病历</h6>
                                    </div>

                                    <div style="margin:25px 0 0 4%">

                                        <div style="display: flex;">
                                            <div style="display: flex;">
                                                <div>主诉</div>

                                                <textarea id="conditionDescr"></textarea>
                                            </div>
                                            <div style="display: flex;margin-left: 60px">
                                                <div>现病史</div>

                                                <textarea id="nowHistory"></textarea>
                                            </div>
                                        </div>

                                        <div style="display: flex;width: 100%;margin-top: 30px">
                                            <div style="width: 100px">检查结果:</div>
                                            <div class="testResult">
                                                体温<input type="text" id="bodyTemperature" style="width: 70px"
                                                         >℃&emsp;
                                                脉搏<input type="text" id="pulse" style="width: 70px"
                                                         >次/分&emsp;
                                                心率<input type="text" id="heartRate" style="width: 70px"
                                                         >次/分&emsp;
                                                血压<input type="text" id="bloodPressure" style="width: 70px"
                                                         >mmHg
                                            </div>
                                            <div>
                                                <button class="btn btn-info mybutton" onclick="changePatientInfor()">
                                                    更新
                                                </button>
                                            </div>

                                        </div>

                                        <div class="conditionDescr">
                                            <div style="display: flex;">
                                                <div>诊断意见</div>

                                                <textarea id="diagnosis"></textarea>
                                            </div>
                                            <div style="margin: 20px 0 0 80px;">
                                                <button class="btn btn-info mybutton2" onclick="ProcessLater()">稍后处理
                                                </button>
                                            </div>
                                        </div>

                                    </div>

                                </div>
                                <div class="split" id="outpatient-two-2">
                                    <div class="card-header py-3">
                                        <h6 class="m-0 font-weight-bold text-primary">电子处方</h6>
                                    </div>
                                    <div style="display: flex">
                                        <div style="font-size: 1.1rem">
                                            <img style="width: 80px;height: 49px"
                                                 th:src="@{/images/icon/prescription.png}">
                                        </div>
                                        <div>
                                            <button class="btn btn-info mybutton2" onclick="selectTemplate()">选择模板
                                            </button>
                                        </div>
                                        <div>

                                        </div>
                                    </div>
                                    <div>

                                        <div style="display: flex;">
                                            药品
                                            <select class='drugSelect' data-placeholder=' '>
                                                <option value=""></option>

                                            </select>
                                            用法：<input type="text" id="usage">
                                            <div>
                                                <button class="btn btn-info mybutton2" onclick="addDrugs()">添加
                                                </button>
                                            </div>
                                        </div>

                                    </div>
                                    <div id="drugs">
                                        <ol>

                                        </ol>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <button class="showbar"></button>
                        <div class="widget-bar">
                            <div>
                                <h3>今日病人</h3>
                            </div>

                            <!--稍后处理的就诊病人-->
                            <div id="allPatientLater" th:fragment="patientLater">
                                <table id="later-table">
                                    <tr th:each="outpatientQueueLater,outpatientLaterStat:${outpatientQueueLaterList}"
                                        class="allpatient">

                                        <th th:text="${outpatientLaterStat.index+1}"></th>

                                        <td th:text="${outpatientQueueLater.cardId}"></td>
                                        <td th:text="${outpatientQueueLater.patientName}"></td>

                                        <td>
                                            <button class="btn btn-info mybutton"
                                                    th:onclick="restorePatientInfor([[${outpatientQueueLater.registerId}]])">
                                                恢复
                                            </button>
                                        </td>
                                    </tr>
                                </table>
                            </div>

                            <div id="allPatientNormal" th:fragment="patientNormal">
                                <div>
                                    队列
                                </div>
                                <table>
                                    <tr th:each="outpatientQueueNormal,outpatientNormalStat:${outpatientQueueNormalList}"
                                        class="allpatient">

                                        <th th:text="${outpatientNormalStat.index+1}"></th>

                                        <td th:text="${outpatientQueueNormal.cardId}"></td>
                                        <td th:text="${outpatientQueueNormal.patientName}"></td>

                                    </tr>
                                </table>

                            </div>


                        </div>
                    </div>

                </div>
            </div>


        </div>
    </div>

</div>
<div>
    <div th:replace="common/common_js :: js(~{::script})"></div>
    <script type="text/javascript" th:src="@{/js/jquery.preloader.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/chosen.jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/split.min.js}"></script>
    <script th:src="@{/sb-admin-2/bootstrap/bootstrap-table.min.js}"></script>
    <script th:src="@{/sb-admin-2/bootstrap/bootstrap-table-zh-CN.js}"></script>
    <script type="text/javascript" th:src="@{/js/mjs/mjs_outpatient.js}"></script>
</div>
</body>
</html>